/*
 * @Author: your name
 * @Date: 2020-10-09 20:47:29
 * @LastEditTime: 2020-10-20 03:16:48
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \longh_admin\src\api\entVerify.js
 */
import request from '@/utils/request'

const entApi = {
  EntList: '/api/entInfo/getPageList',
  EntBaseInfoById: '/api/entInfo/entBaseInfo',
  EntCheck: '/api/entInfo/checkEntBase',
  EntCertList: '/api/entInfo/getEntCertPageList',
  EntCertInfo: '/api/entInfo/entCertInfo',
  EntCertCheck: '/api/entInfo/checkEntCert'
}

/**
 * 获取企业基本信息列表
 * @param {Object} parameter -{"auditStatus":"审核状态","keyword":"关键字","current":"页码","size":"页数"}
 */
export function getEntBaseList(parameter) {
  return request({
    url: entApi.EntList,
    method: 'post',
    data: parameter
  })
}

/**
 * 根据企业主键获取企业详细信息
 * @param {string} entId -企业主键Id
 */
export function getEntBaseInfoById(entId) {
  return request({
    url: entApi.EntBaseInfoById,
    method: 'post',
    data: {
      "id": entId
    }
  })
}

/**
 * 审核企业补充信息
 * @param {Object} parameter 
 * -{"id":"审核企业Id","owner":"审核企业用户Id","isPass":"是否审核通过(true/false)","message":"审核不通过原因"}
 */
export function checkEntBase(parameter) {
  return request({
    url: entApi.EntCheck,
    method: 'post',
    data: parameter
  })
}

/**
 * 获取资质/荣誉分页列表
 * @param {Object} parameter 
 * -{"entName":"企业名","certName":"证书名","auditStatus":"审核状态","type":"资质1/荣誉2","current":"页码","size":"条数"}
 */
export function getEntCertList(parameter) {
  return request({
    url: entApi.EntCertList,
    method: 'post',
    data: parameter
  })
}

/**
 * 
 * @param {string} entCertId -资质/荣誉主键Id
 */
export function getEntCertInfoById(entCertId) {
    return request({
      url: entApi.EntCertInfo,
      method: 'post',
      data: {
        "id": entCertId
      }
    })
  }

  /**
   * 资质/荣誉审核
   * @param {object} parameter 
   * -{"id":"资质/荣誉Id","certNo":"证书编号","owner":"证书用户Id","isPass":"是否审核通过","message":"审核不通过原因","type":"1资质/2荣誉"}
   */
  export function checkEntCert(parameter) {
    return request({
      url: entApi.EntCertCheck,
      method: 'post',
      data: parameter
    })
  }